// pages/my/setname/setname.js
Page({
  data: {
    name: "王大胆"
  },
  onLoad: function (options) {
    this.setData({
      name: options.name
    });
  },
  clear() {
    this.setData({
      name: ""
    });
  },
  submit() {
    if (!this.data.name) {
      getApp().globalData.vant.toast("昵称不能为空");
    } else {
      wx.setStorageSync("set_name", this.data.name);
      wx.navigateBack();
    }
  }
})